package com.jiepu.daily.corejava.advanceed.part2.day0717.Node_demo;

/**
 * @Description:
 * @author: xinjie.txt
 * @date: 2020/7/20  8:21
 */
public class NodeTest {

	public static void main(String[] args) {

		Node n1 = new Node();
		n1.data = "hello";
		Node n2 = new Node();
		n2.data = "world";
		Node n3 = new Node();
		n3.data = "hi";
		Node n4 = new Node();
		n4.data = "briup";

		n1.next = n2;
		n2.next = n3;
		n3.next = n4;

		print(n1);

	}

	public static void print(Node first) {
		Node n = first;
		while(n != null) {
			System.out.println(n.data);
			n = n.next;
		}
	}





}
